package com.larry.mr.flow;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * @ProjectName map-reduce
 * @Author larry
 * @Date 13:46 2022/3/31
 * @Description TODO
 **/
public class ProvincePartitioner extends Partitioner<Text,FlowBean> {
    @Override
    public int getPartition(Text text, FlowBean flowBean, int i) {

        String num = text.toString();

        if (num.contains("136")){
            return 0;
        }else if (num.contains("137")){
            return 1;
        }

        return 2;

    }
}
